﻿# -*- coding:UTF-8 -*-
#!/usr/bin/env python

import os

from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app

def error404(self , path = '404.html'):
    self.response.set_status(404)
    path = os.path.join(os.path.dirname(__file__), path)
    template_values = {
        'path': self.request.path
    }
    self.response.out.write(template.render(path, template_values))

class MainPage(webapp.RequestHandler):
    def get(self):
        error404(self)

application = webapp.WSGIApplication(
                                     [('.*', MainPage)] ,
                                     debug=True)

def main():
    run_wsgi_app(application)

if __name__ == "__main__":
    main()